package br.com.jbssistemas.dtos;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

/**
 *
 * @author Carol Duarte
 */
@Entity
@Table(name = "veiculos")
public class Veiculos implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 10, max = 60, message = "Minimo {min} e Maximo {max} caracteres")
    private String placa;

    @ManyToOne
    @JoinColumn(name = "setores")
    private Setores setores;

    // Falta COMBUSTIVEL
    
    
    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 1, max = 1, message = "Minimo {min} e Maximo {max} caracteres")
    private String maquinario;

    private int ktmInicial;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 10, max = 60, message = "Minimo {min} e Maximo {max} caracteres")
    private String descricao;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 3, max = 20, message = "Minimo {min} e Maximo {max} caracteres")
    private String modelo;

    @Length(min = 4, max = 4, message = "*Informe o ano corretamente")
    private int ano;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 17, max = 17, message = "Minimo {min} e Maximo {max} caracteres")
    private String chassi;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 4, max = 15, message = "Minimo {min} e Maximo {max} caracteres")
    private String cor;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 10, max = 15, message = "Minimo {min} e Maximo {max} caracteres")
    private String renavan;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 5, max = 40, message = "Minimo {min} e Maximo {max} caracteres")
    private String responsavel;

    private int tombamento;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 1, max = 1, message = "Minimo {min} e Maximo {max} caracteres")
    private String situacao;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(min = 3, max = 10, message = "Minimo {min} e Maximo {max} caracteres")
    private String conservacao;

    private Date dataAquisicao;

    private int capTanque;

    private int consumoMedio;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(max = 50, message = "Minimo {min} e Maximo {max} caracteres")
    private String observacoes;

    @Length(max = 60, message = "Maximo {max} caracteres")
    private String rota;

    @NotEmpty(message = "*Campo Obrigatorio")
    @Length(max = 8, message ="Minimo {min} e Maximo {max} caracteres")
    private String vinculo;

}
